home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 4 / BBS in a Box - Macintosh - Volume IV (January 1992) (BBS in a Box).iso / Files / Tele / H / Host File* (.txt) < prev    next >
Encoding:
MS Visual FoxPro App  |  1987-06-22  |  3.3 KB  |  75 lines  |  [TEXT/MACA]

  1. RRH.SystemTask.patch
  2. TEXTMACA
  3. Bonjour,
  4. You use Red Ryder Host 1.4 in a dedicated communications server application in
  5. your company and find that you cannot use this dedicated machine to run a mail
  6. server (inBox, TopMail...) or a disk server (MacServe, Tops...) because Host
  7. doesn't support desk accessories and drivers (DRVR resources).
  8. Well, a missing SystemTask trap call is the culprit!  Scott Watson having
  9. decided to omit desk accessory support, he probably decided that a SystemTask
  10. was superfluous.  SystemTask provides time for desk accessories and DRIVERS to
  11. do their stuff and that's what we're after.  All (or at least most of them) of
  12. the servers use a DRVR to do their stuff but cannot operate if they don't
  13. receive some CPU time.
  14. The little patch shown below is for use on Red Ryder Host 1.4 ONLY as it is
  15. highly version dependant.  You will need a file editor such as FEdit or
  16. MacSnoop to apply the patch.
  17. Open the Red Ryder Host 1.4 file and 
  18. search for: 558F 3F3C FFFF 489D EB7E A970 101F 4880 48C0 2B40 F290 4AAD F290
  19. change for: A9B4 558F 3F3C FFFF 486D EB7E A970 101F 4880 48C0 2B40 F290 4A80
  20. Save the modified sector and you now have a SystemTasked RRH!
  21. *** Technical stuff ***
  22. The patch modifies the following code.  Those of you using MacNosy can look at
  23. the complete 
  24. proc58
  25.  to see exactly what it does (a simple GetNextEvent loop).
  26. The SystemTask call is usually put close to a GetNextEvent to be executed as
  27. often as possible.  For MacNosy users: GetNextEvent calls can also be found in
  28. proc127
  29. proc144
  30.  and 
  31. proc145
  32. .  I was using versions 2.23 and 2.66 (as
  33. soon as I received it!) of Nosy.
  34. The patch involved finding a word that could be scrapped to make place for the
  35. SystemTask trap.  Fortunatly, all compilers (Scott uses LightSpeed C) have
  36. problems
  37.  or bits of code that are not not optimized.  In this case,
  38. the result of GetNextEvent (a boolean, true if an event has occured) is moved
  39. from a register (D0) to a global variable (glob433(A5)) and the this same
  40. global is used to see if and event has occured.  Well, the register D0 still
  41. holds the result, why not use it!  And since this saves a word (2 bytes), we
  42. just found our space to put the SystemTask in!!!
  43. Here's the original code:
  44.     proc58    SUBQ.L    #2,A7        ; make space on stack
  45.         PUSH    #$FFFF        ; eventMask
  46.         PEA glob272(A5)        ; aka EventRecord
  47.         _GetNextEvent
  48.         POP.B
  49.         EXT
  50.         EXT.L
  51.         MOVE.L    D0,glob433(A5)    ; check if an event as occured
  52.         TST.L    glob433(A5)
  53.         BEQ.S    proc58.1    ; =0, no event, skip handling
  54.         ...            ; rest of proc58, event handling
  55. And with the modification made:
  56.     proc58    _SystemTask
  57.         SUBQ.L    #2,A7
  58.         PUSH    #$FFFF
  59.         PEA glob272(A5)
  60.         _GetNextEvent
  61.         POP.B
  62.         EXT
  63.         EXT.L
  64.         MOVE.L    D0,glob433(A5)
  65.         TST.L    D0
  66.         BEQ.S    proc58.1
  67.         ...
  68. It has been running on two BBSs for two weeks now with no apparent problems.
  69. Please keep me informed of your results, good or bad.
  70. Martin Durand
  71. Sysop of Synapse, the ONLY truly French Red Ryder Host BBS
  72. (418) 658-6955, 300/1200/2400, 24 hours
  73. GEnie: MDURAND
  74. Compuserve: 76064,224
  75.